package mystruts;

import com.opensymphony.xwork2.ActionSupport;

public class TestAction extends ActionSupport {
		
	public String execute() throws Exception {		
		this.LOG.debug("idiot");
		this.LOG.info("moron");
		System.out.println("GG");
		System.out.println("userGG:" + getUsername());
		System.out.println("pasGG:" + getPassword());
		String nextpage="";
		if (getUsername() == null && getPassword() == null){
			this.setMes("welcome");
			nextpage="testlogin";
		}else if ("abc".equals(getUsername()) && "123".equals(getPassword())){
			nextpage=SUCCESS;
		}else{
			this.setMes("idiot");
			nextpage="testlogin";
		}
		
        return nextpage;
    }
	
	
	private String username;
	private String password;
	private String mes;
	
	public String getMes() {
		return mes;
	}
	public void setMes(String mes) {
		this.mes = mes;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	
}
